﻿<%@ Page Language="C#" MasterPageFile="../../MasterPage.Master" AutoEventWireup="true" CodeBehind="ICM_Requisition_Cut_Stock.aspx.cs" Inherits="KPIS.GERP.GIMS.APP.APP_UI.Form.ICM_Requisition_Cut_Stock" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="server">
<script type="text/javascript">
              function DetailRequisition(requisition_code)
              {
                   radopen("../Edit_Form/ICM_Requisition_Cut_Stock.aspx"+ "?Requsition_Code="+requisition_code ,"WindowDetail");
              }
              function closeRadWindow(sender, args) 
              {
                   $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest();
              }

</script>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
                    <AjaxSettings>
                        <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                            <UpdatedControls>
                                <telerik:AjaxUpdatedControl ControlID="grdRequisition" LoadingPanelID="RadAjaxLoadingPanel1" />
                            </UpdatedControls>
                        </telerik:AjaxSetting>
                       
                        
                    </AjaxSettings>
</telerik:RadAjaxManager>
<%--<div class="moduleContent1000">
           <div class="moduleDivBottom1000">
                 <asp:Panel ID="Panel2" runat="server" CssClass="contentPaneDiv" Height="30px" ScrollBars="Auto" >
                            <table cellpadding="0" cellspacing="0">
                                <tr class="command-list">
                                    <td>
                                        <asp:LinkButton ID="btnInsert_Item" runat="server" CausesValidation="false" CssClass="LinkButton" OnClick="btnInsert_Click">
                                        <img alt="" src="../Image/Grid/AddRecord.gif" style="border:0px;vertical-align:middle;" />&#160;&#160;เพิ่มข้อมูลใหม่ </asp:LinkButton>
                                    </td>
                                </tr>
                            </table>
                  </asp:Panel>
            </div>
</div>--%>
<div class="moduleContent1000">
              <div class="moduleDivBottom1000">
                 <asp:Panel ID="Panel1" runat="server" CssClass="contentPaneDiv" Height="470px" ScrollBars="Auto" align = "center" >    
                           <div class="header-grid">
                                <table>
                                       <tr>
                                                <td>
                                                       <asp:Label ID="Label4" runat="server" Text="ข้อมูลของทุกหน่วยงานที่มีการขอเบิกของ"></asp:Label>
                                                </td>
                                                <td>
                                                       <asp:Panel runat ="server" ID="PanelCombo">
                                                                    <table>
                                                                           <tr>
                                                                                 <%-- <td>
                                                                                             <asp:Label ID="lblStatusRequest" runat = "server" Text ="กรองสถานะของการตัดเบิกของจากคลัง" />
                                                                                  </td>--%>
                                                                                  <td>
                                                                                             <telerik:RadComboBox ID="cmbStatusRequest" Runat="server"  AutoPostBack="true" OnSelectedIndexChanged="cmbStatusRequest_OnSelectedIndexChanged">
                                                                                             </telerik:RadComboBox>
                                                                                  </td>
                                                                           </tr>
                                                                    </table>
                                                       </asp:Panel>  
                                                </td>
                                       </tr>
                                </table>
                           </div>
                           <table align="left">
                                <tr>
                                       <td>
                                               <telerik:RadGrid ID="grdRequisition" runat="server" AutoGenerateColumns="false"
                                                                        AllowMultiRowEdit="false" AllowMultiRowSelection="true" ShowStatusBar="true"
                                                                        Width="977px" Height="380px" AllowPaging="true" AllowFilteringByColumn="true"
                                                                        GroupingSettings-GroupByFieldsSeparator="&nbsp;&nbsp;&nbsp;&nbsp;"
                                                                        GroupingSettings-GroupContinuedFormatString=""
                                                                        GroupingSettings-GroupContinuesFormatString=""
                                                                        GroupingSettings-GroupSplitFormat="" PageSize ="6"
                                                                        OnNeedDataSource="grdRequisition_NeedDataSource" align ="left">
                                                                        <MasterTableView AllowMultiColumnSorting="True" CellSpacing="-1" GroupLoadMode="Client"
                                                                            DataKeyNames="requisition_code" NoMasterRecordsText="< ไม่มีข้อมูล >" GroupsDefaultExpanded="true">
                                                                            <RowIndicatorColumn>
                                                                                <HeaderStyle Width="20px" />
                                                                            </RowIndicatorColumn>
                                                                            <ExpandCollapseColumn >
                                                                                <HeaderStyle Width="20px" />
                                                                            </ExpandCollapseColumn>
                                                                            <GroupByExpressions>
                                                                                    <telerik:GridGroupByExpression>
                                                                                        <GroupByFields>
                                                                                            <telerik:GridGroupByField FieldName="requisition_date" HeaderText="วันที่ขอเบิก" />
                                                                                        </GroupByFields>
                                                                                        <SelectFields>
                                                                                            <telerik:GridGroupByField FieldName="requisition_date" HeaderText="วันที่ขอเบิก"  />
                                                                                        </SelectFields>
                                                                                    </telerik:GridGroupByExpression>
                                                                            </GroupByExpressions>        
                                                                            <Columns>   
                                                                                <telerik:GridBoundColumn DataField="movement_code" 
                                                                                    HeaderText="รหัสรายการตัดเบิก" UniqueName="movement_code"
                                                                                    FilterControlWidth="100%" AutoPostBackOnFilter="true" 
                                                                                    CurrentFilterFunction="Contains" ShowFilterIcon="false" HeaderStyle-Width="109px"
                                                                                    HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center">
                                                                                </telerik:GridBoundColumn>
                                                                                <%--<telerik:GridBoundColumn DataField="requisition_date" DataFormatString="{0:d}"
                                                                                    HeaderText="วันที่ขอเบิก" UniqueName="requisition_date"
                                                                                    FilterControlWidth="100%" AutoPostBackOnFilter="true"
                                                                                    CurrentFilterFunction="Contains" ShowFilterIcon="false" HeaderStyle-Width="63px"
                                                                                    HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center">
                                                                                </telerik:GridBoundColumn>--%>
                                                                                <telerik:GridTemplateColumn DataField="requisition_code" HeaderText="เลขที่ขอเบิกของ" ShowFilterIcon="false" HeaderStyle-Font-Bold="true" 
                                                                                        HeaderStyle-Width="109px" HeaderStyle-HorizontalAlign="Center" FilterControlWidth="100%" UniqueName="requisition_code" >
                                                                                        <ItemTemplate >                                                                                                                           
                                                                                                <asp:LinkButton ID="targetControl" runat="server" Text='<%# Eval("requisition_code") %>' 
                                                                                                OnClientClick='<%# string.Format("return DetailRequisition(\"{0}\");", Eval("requisition_code")) %>' Font-Size="Small" > 
                                                                                                </asp:LinkButton><%--OnClientClick='<%# string.Format("return openReceiveEdit(\"{0}\",\"{1}\");", Eval("trans_mas_seq"),"Edit") %>'--%>
                                                                                        </ItemTemplate>
                                                                                </telerik:GridTemplateColumn>
                                                                                <telerik:GridTemplateColumn DataField="description" HeaderText="รายการเบิกของ" ShowFilterIcon="false" HeaderStyle-Font-Bold="true"
                                                                                        HeaderStyle-HorizontalAlign="Center" FilterControlWidth="100%" UniqueName="description">
                                                                                        <ItemTemplate >                                                                                                                           
                                                                                                <asp:LinkButton ID="description" runat="server" Text='<%# Eval("description") %>' Font-Size="Small" 
                                                                                                OnClientClick='<%# string.Format("return DetailRequisition(\"{0}\");", Eval("requisition_code")) %>'  > 
                                                                                                </asp:LinkButton>
                                                                                        </ItemTemplate>
                                                                                </telerik:GridTemplateColumn>
                                                                                <telerik:GridBoundColumn DataField="icm_obj_type_name" 
                                                                                    HeaderText="ประเภทวัสดุ" UniqueName="icm_obj_type_name" HeaderStyle-Width="70px"
                                                                                    FilterControlWidth="100%" AutoPostBackOnFilter="true" AllowFiltering = "true"
                                                                                    CurrentFilterFunction="Contains" ShowFilterIcon="false"
                                                                                    HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center">
                                                                                </telerik:GridBoundColumn>
                                                                                <telerik:GridBoundColumn DataField="job_site_name" 
                                                                                    HeaderText="หน่วยงานที่ขอเบิก" UniqueName="job_site_name"
                                                                                    FilterControlWidth="100%" AutoPostBackOnFilter="true" AllowFiltering = "true"
                                                                                    CurrentFilterFunction="Contains" ShowFilterIcon="false" HeaderStyle-Width="130px"
                                                                                    HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center">
                                                                                </telerik:GridBoundColumn>
                                                                                <telerik:GridBoundColumn DataField="employee_name" 
                                                                                    HeaderText="ผู้ขอเบิก" UniqueName="employee_name"
                                                                                    FilterControlWidth="100%" AutoPostBackOnFilter="true" AllowFiltering = "true"
                                                                                    CurrentFilterFunction="Contains" ShowFilterIcon="false" HeaderStyle-Width="100px"
                                                                                    HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center">
                                                                                </telerik:GridBoundColumn>
                                                                                <telerik:GridBoundColumn DataField="approve_name" 
                                                                                    HeaderText="ผู้อนุมัติการเบิก" UniqueName="approve_name"
                                                                                    FilterControlWidth="100%" AutoPostBackOnFilter="true" AllowFiltering = "true"
                                                                                    CurrentFilterFunction="Contains" ShowFilterIcon="false" HeaderStyle-Width="100px"
                                                                                    HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center">
                                                                                </telerik:GridBoundColumn>
                                                                                <telerik:GridBoundColumn DataField="status_name" 
                                                                                    HeaderText="สถานะการเบิก" UniqueName="status_name"
                                                                                    FilterControlWidth="100%" AutoPostBackOnFilter="true"
                                                                                    CurrentFilterFunction="Contains" ShowFilterIcon="false" HeaderStyle-Width="70px" 
                                                                                    HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center">
                                                                                </telerik:GridBoundColumn>
                                                                            </Columns>
                                                                            <PagerStyle Mode="NumericPages" AlwaysVisible="true" 
                                                                                FirstPageToolTip="กลับหน้าแรก" LastPageToolTip="ไปหน้าสุดท้าย" 
                                                                                NextPagesToolTip="หน้าถัดไป" NextPageToolTip="หน้าถัดไป" 
                                                                                PrevPagesToolTip="ย้อนกลับ" PrevPageToolTip="ย้อนกลับ" />
                                                                            </MasterTableView>
                                                                <GroupingSettings GroupByFieldsSeparator="&nbsp;&nbsp;&nbsp;&nbsp;" 
                                                                    GroupContinuedFormatString="" GroupContinuesFormatString="" 
                                                                    GroupSplitFormat="" />
                                                                <ClientSettings EnableRowHoverStyle="True">
                                                                    <Selecting AllowRowSelect="true" />
                                                                    <Scrolling AllowScroll="true" UseStaticHeaders="true" />
                                                                </ClientSettings>
                                                     </telerik:RadGrid> 
                                       </td>
                                </tr>
                     </table>        
                 </asp:Panel>
              </div>
</div>       

<telerik:RadWindowManager ID="RadWindowManager1" runat="server" >
    <Windows>
        <telerik:RadWindow ID="WindowDetail" runat="server" Width="1020px" Height="530px"
            showcontentduringload="false"  VisibleStatusbar="false"
            Modal="true" Skin = "Vista" behaviors="Close"
            title="แสดงรายการขอเบิกของที่ส่งมาจากหน่วยงาน" 
            OnClientClose="closeRadWindow" >
        </telerik:RadWindow>
    </Windows>
</telerik:RadWindowManager>          
</asp:Content>
